﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraBars;

namespace Smart.Common
{
    public partial class xucToolBarB : xucBase
    {
        public xucToolBarB()
        {
            InitializeComponent();
        }
        public event ButtonClickEventHander AddClick;

        public event ButtonClickEventHander CancleClick;

        public event ButtonClickEventHander ChangeClick;

        public event ButtonClickEventHander ClearClick;

        public event ButtonClickEventHander CloseClick;

        public event ButtonClickEventHander ConstructClick;

        public event ButtonClickEventHander CopyClick;

        public event ButtonClickEventHander CustomColumnClick;

        public event ButtonClickEventHander DeleteClick;

        public event ButtonClickEventHander EditClick;

        public event ButtonClickEventHander ExportClick;

        public event ButtonClickEventHander FaceDefaultClick;

        public event ButtonClickEventHander HelpClick;

        public event ButtonClickEventHander HistoryClick;

        public event ButtonClickEventHander ImportClick;

        public event ButtonClickEventHander InventoryClick;

        public event ButtonClickEventHander MirrorClick;

        public event ButtonClickEventHander OptionClick;

        public event ButtonClickEventHander PermisionClick;

        public event ButtonClickEventHander PrintClick;

        public event ButtonClickEventHander ProductDetailClick;

        public event ButtonClickEventHander ReadDataByIdClick;

        public event ButtonClickEventHander ReadDataFromFileClick;

        public event ButtonClickEventHander ReadLayoutClick;

        public event ButtonClickEventHander RefreshClick;

        public event ButtonClickEventHander RestoreDataTempClick;

        public event ButtonClickEventHander SaveClick;

        public event ButtonClickEventHander SaveDataByIdClick;

        public event ButtonClickEventHander SaveDataTempClick;

        public event ButtonClickEventHander SaveDataToFileClick;

        public event ButtonClickEventHander SaveLayoutClick;

        public event ButtonClickEventHander SaveNewClick;

        public event ButtonClickEventHander SearchClick;

        public event ButtonClickEventHander SelectAllClick;
        public virtual void MakerInterface()
        {
        }

        private void RaiseAddClickEventHander()
        {
            if (this.AddClick != null)
            {
                this.AddClick(this);
            }
        }

        private void RaiseCancleClickEventHander()
        {
            if (this.CancleClick != null)
            {
                this.CancleClick(this);
            }
        }

        private void RaiseChangeClickEventHander()
        {
            if (this.ChangeClick != null)
            {
                this.ChangeClick(this);
            }
        }

        private void RaiseClearClickEventHander()
        {
            if (this.ClearClick != null)
            {
                this.ClearClick(this);
            }
        }

        private void RaiseCloseClickEventHander()
        {
            if (this.CloseClick != null)
            {
                this.CloseClick(this);
            }
        }

        private void RaiseConstructClickEventHander()
        {
            if (this.ConstructClick != null)
            {
                this.ConstructClick(this);
            }
        }

        private void RaiseCopyClickEventHander()
        {
            if (this.CopyClick != null)
            {
                this.CopyClick(this);
            }
        }

        private void RaiseCustomColumnClick()
        {
            ButtonClickEventHander customColumnClick = this.CustomColumnClick;
            if (customColumnClick != null)
            {
                customColumnClick(this);
            }
        }

        private void RaiseDeleteClickEventHander()
        {
            if (this.DeleteClick != null)
            {
                this.DeleteClick(this);
            }
        }

        private void RaiseEditClickEventHander()
        {
            if (this.EditClick != null)
            {
                this.EditClick(this);
            }
        }

        private void RaiseExportEventHander()
        {
            if (this.ExportClick != null)
            {
                this.ExportClick(this);
            }
        }

        private void RaiseFaceDefaultClick()
        {
            ButtonClickEventHander faceDefaultClick = this.FaceDefaultClick;
            if (faceDefaultClick != null)
            {
                faceDefaultClick(this);
            }
        }

        private void RaiseHelpClickEventHander()
        {
            if (this.HelpClick != null)
            {
                this.HelpClick(this);
            }
        }

        private void RaiseHistoryClickEventHander()
        {
            if (this.HistoryClick != null)
            {
                this.HistoryClick(this);
            }
        }

        private void RaiseImportClickEventHander()
        {
            if (this.ImportClick != null)
            {
                this.ImportClick(this);
            }
        }

        private void RaiseInventoryClickEventHander()
        {
            if (this.InventoryClick != null)
            {
                this.InventoryClick(this);
            }
        }

        private void RaiseMirrorClickEventHander()
        {
            if (this.MirrorClick != null)
            {
                this.MirrorClick(this);
            }
        }

        private void RaiseOptionClickEventHander()
        {
            if (this.OptionClick != null)
            {
                this.OptionClick(this);
            }
        }

        private void RaisePermisionClickEventHander()
        {
            if (this.PermisionClick != null)
            {
                this.PermisionClick(this);
            }
        }

        private void RaisePrintClickEventHander()
        {
            if (this.PrintClick != null)
            {
                this.PrintClick(this);
            }
        }

        private void RaiseProductDetailClickEventHander()
        {
            if (this.ProductDetailClick != null)
            {
                this.ProductDetailClick(this);
            }
        }

        private void RaiseReadDataByIdClickEventHander()
        {
            if (this.ReadDataByIdClick != null)
            {
                this.ReadDataByIdClick(this);
            }
        }

        private void RaiseReadFromFileClickEventHander()
        {
            if (this.ReadDataFromFileClick != null)
            {
                this.ReadDataFromFileClick(this);
            }
        }

        private void RaiseReadLayoutClickEventHander()
        {
            if (this.ReadLayoutClick != null)
            {
                this.ReadLayoutClick(this);
            }
        }

        private void RaiseRefreshClickEventHander()
        {
            if (this.RefreshClick != null)
            {
                this.RefreshClick(this);
            }
        }

        private void RaiseRestoreTempClickEventHander()
        {
            if (this.RestoreDataTempClick != null)
            {
                this.RestoreDataTempClick(this);
            }
        }

        private void RaiseSaveClickEventHander()
        {
            if (this.SaveClick != null)
            {
                this.SaveClick(this);
            }
        }

        private void RaiseSaveDataByIdClickEventHander()
        {
            if (this.SaveDataByIdClick != null)
            {
                this.SaveDataByIdClick(this);
            }
        }

        private void RaiseSaveLayoutClickEventHander()
        {
            if (this.SaveLayoutClick != null)
            {
                this.SaveLayoutClick(this);
            }
        }

        private void RaiseSaveNewClickEventHander()
        {
            if (this.SaveNewClick != null)
            {
                this.SaveNewClick(this);
            }
        }

        private void RaiseSaveTempClickEventHander()
        {
            if (this.SaveDataTempClick != null)
            {
                this.SaveDataTempClick(this);
            }
        }

        private void RaiseSaveToFileClickEventHander()
        {
            if (this.SaveDataToFileClick != null)
            {
                this.SaveDataToFileClick(this);
            }
        }

        private void RaiseSearchClickEventHander()
        {
            if (this.SearchClick != null)
            {
                this.SearchClick(this);
            }
        }

        private void RaiseSelectAllClickEventHander()
        {
            if (this.SelectAllClick != null)
            {
                this.SelectAllClick(this);
            }
        }

        public virtual void SetInterface()
        {
        }

        [DefaultValue(false), Category("Design"), Description("Button Add")]
        public BarItemVisibility ButtonAdd
        {
            get
            {
                return this.bbiAdd.Visibility;
            }
            set
            {
                this.bbiAdd.Visibility = value;
                base.Update();
            }
        }

        [Category("Design"), Description("Button Cancel"), DefaultValue(false)]
        public BarItemVisibility ButtonCancel
        {
            get
            {
                return this.bbiCancel.Visibility;
            }
            set
            {
                this.bbiCancel.Visibility = value;
                base.Show();
                this.BarM.Reset();
            }
        }

        //[DefaultValue(false), Category("Design"), Description("Button Change")]
        //public BarItemVisibility ButtonChange
        //{
        //    get
        //    {
        //        return this.bbiChange.Visibility;
        //    }
        //    set
        //    {
        //        this.bbiChange.Visibility = value;
        //        base.Update();
        //    }
        //}

        [Category("Design"), DefaultValue(false), Description("Button Delete")]
        public BarItemVisibility ButtonDelete
        {
            get
            {
                return this.bbiDelete.Visibility;
            }
            set
            {
                this.bbiDelete.Visibility = value;
                base.Update();
            }
        }

        //[DefaultValue(false), Category("Design"), Description("Button Edit")]
        //public BarItemVisibility ButtonEdit
        //{
        //    get
        //    {
        //        return this.bbiEdit.Visibility;
        //    }
        //    set
        //    {
        //        this.bbiEdit.Visibility = value;
        //        base.Update();
        //    }
        //}

        [Category("Design"), DefaultValue(false), Description("Button Delete")]
        public BarItemVisibility ButtonExport
        {
            get
            {
                return this.bbiExport.Visibility;
            }
            set
            {
                this.bbiExport.Visibility = value;
                base.Update();
            }
        }

        //[Category("Design"), DefaultValue(false), Description("Button Delete")]
        //public BarItemVisibility ButtonOption
        //{
        //    get
        //    {
        //        return this.bbiOption.Visibility;
        //    }
        //    set
        //    {
        //        this.bbiOption.Visibility = value;
        //        base.Update();
        //    }
        //}

        [Category("Design"), DefaultValue(false), Description("Button Print")]
        public BarItemVisibility ButtonPrint
        {
            get
            {
                return this.bbiPrint.Visibility;
            }
            set
            {
                this.bbiPrint.Visibility = value;
                base.Update();
            }
        }

        [DefaultValue(false), Category("Design"), Description("Button Save")]
        public BarItemVisibility ButtonSave
        {
            get
            {
                return this.bbiSave.Visibility;
            }
            set
            {
                this.bbiSave.Visibility = value;
                base.Show();
                this.BarM.Reset();
            }
        }

        [Category("Design"), DefaultValue(false), Description("Button SaveNew")]
        public BarItemVisibility ButtonSaveNew
        {
            get
            {
                return this.bbiSaveNew.Visibility;
            }
            set
            {
                this.bbiSaveNew.Visibility = value;
                base.Show();
                this.BarM.Reset();
            }
        }

        private void bbiAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.RaiseAddClickEventHander();
        }

        private void bbiSaveNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.bbiSaveM.Tag = "Add";
            this.bbiSaveM.ImageIndex = this.bbiSaveNew.ImageIndex;
            this.bbiSaveM.Caption = this.bbiSaveNew.Caption;
            this.RaiseSaveNewClickEventHander();
        }

        private void bbiSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.bbiSaveM.Tag = "Close";
            this.bbiSaveM.ImageIndex = this.bbiSave.ImageIndex;
            this.bbiSaveM.Caption = this.bbiSave.Caption;
            this.RaiseSaveClickEventHander();
        }

        private void bbiCancel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.RaiseCancleClickEventHander();
        }

        private void bbiClose_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseCloseClickEventHander();
        }

        private void bbiCopy_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseCopyClickEventHander();
        }

        private void bbiCustomColumns_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseCustomColumnClick();
        }

        private void bbiDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseDeleteClickEventHander();
        }

        private void bbiDouble_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseMirrorClickEventHander();
        }

        private void bbiExport_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseExportEventHander();
        }

        private void bbiFaceDefault_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseFaceDefaultClick();
        }

        private void bbiHelp_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseHelpClickEventHander();
        }

        private void bbiHistory_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseHistoryClickEventHander();
        }

        private void bbiImport_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseImportClickEventHander();
        }

        private void bbiInventory_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseInventoryClickEventHander();
        }

        private void bbiPrint_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaisePrintClickEventHander();
        }

        private void bbiProductDetail_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseProductDetailClickEventHander();
        }

        private void bbiReadFromFile_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseReadFromFileClickEventHander();
        }

        private void bbiReadLayout_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseReadLayoutClickEventHander();
        }

        private void bbiRefresh_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseRefreshClickEventHander();
        }

        private void bbiRestoreTemp_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseRestoreTempClickEventHander();
        }

        private void bbiSaveLayout_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseSaveLayoutClickEventHander();
        }

        private void bbiSaveToFile_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseSaveToFileClickEventHander();
        }

        private void bbiSearch_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseSearchClickEventHander();
        }

        private void bbiSelectAll_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.RaiseSelectAllClickEventHander();
        }
    }
}
